<template>
    <div class="my-fav">

        <van-nav-bar title="我的收藏" left-arrow @click-left="$router.back()" />
        <van-empty description="暂无内容" v-if="isShow" />
        <list :API="getFavList" :cancelAPI="removeFav" :params="{ user_id: uid }" v-else />


    </div>
</template>

<script>
import list from '@/components/list.vue';
import { getFavList, removeFav } from '@/API/api';
import { SwipeCell, Card, Button, Empty } from 'vant';
import { mapState } from 'vuex';
export default {
    data() {
        return {
            getFavList,
            removeFav,
            isShow: false
        }
    },
    computed: {
        ...mapState('users', ['uid'])
    },
    components: {
        list,
        [SwipeCell.name]: SwipeCell,
        [Card.name]: Card,
        [Button.name]: Button,
        [Empty.name]: Empty,
    },
    methods: {
        show() {
            this.isShow = true
            console.log(this.isShow);
        }      
    },
    mounted() {
        this.$bus.$on('null', this.show)
    },
    beforeDestroy(){
        this.$bus.$off('null')
    }

}
</script>

<style lang="less" scoped>
::v-deep .van-nav-bar {
    background-color: @baseColor;
}
</style>